package com.ruoyi.member.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.MemberAuthInfoMapper;
import com.ruoyi.db.domain.MemberAuthInfo;
import com.ruoyi.member.service.IMemberAuthInfoService;

/**
 * 用户认证信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-13
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class MemberAuthInfoServiceImpl implements IMemberAuthInfoService
{
    @Autowired
    private MemberAuthInfoMapper memberAuthInfoMapper;

    /**
     * 查询用户认证信息
     * 
     * @param uid 用户认证信息主键
     * @return 用户认证信息
     */
    @Override
    public MemberAuthInfo selectMemberAuthInfoByUid(Long uid)
    {
        return memberAuthInfoMapper.selectMemberAuthInfoByUid(uid);
    }

    /**
     * 查询用户认证信息列表
     * 
     * @param memberAuthInfo 用户认证信息
     * @return 用户认证信息
     */
    @Override
    public List<MemberAuthInfo> selectMemberAuthInfoList(MemberAuthInfo memberAuthInfo)
    {
        return memberAuthInfoMapper.selectMemberAuthInfoList(memberAuthInfo);
    }

    @Override
    public List<Map<String, Object>> selectMemberAuthInfoMapList(MemberAuthInfo memberAuthInfo) {
        return memberAuthInfoMapper.selectMemberAuthInfoMapList(memberAuthInfo);
    }

    /**
     * 新增用户认证信息
     * 
     * @param memberAuthInfo 用户认证信息
     * @return 结果
     */
    @Override
    public int insertMemberAuthInfo(MemberAuthInfo memberAuthInfo)
    {
        memberAuthInfo.setCreateTime(DateUtils.getNowDate());
        return memberAuthInfoMapper.insertMemberAuthInfo(memberAuthInfo);
    }

    /**
     * 修改用户认证信息
     * 
     * @param memberAuthInfo 用户认证信息
     * @return 结果
     */
    @Override
    public int updateMemberAuthInfo(MemberAuthInfo memberAuthInfo)
    {
        memberAuthInfo.setUpdateTime(DateUtils.getNowDate());
        return memberAuthInfoMapper.updateMemberAuthInfo(memberAuthInfo);
    }

    /**
     * 批量删除用户认证信息
     * 
     * @param uids 需要删除的用户认证信息主键
     * @return 结果
     */
    @Override
    public int deleteMemberAuthInfoByUids(Long[] uids)
    {
        return memberAuthInfoMapper.deleteMemberAuthInfoByUids(uids);
    }

    /**
     * 删除用户认证信息信息
     * 
     * @param uid 用户认证信息主键
     * @return 结果
     */
    @Override
    public int deleteMemberAuthInfoByUid(Long uid)
    {
        return memberAuthInfoMapper.deleteMemberAuthInfoByUid(uid);
    }
}
